/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Raytracing.Shaders;

import processing.core.PVector;

/**
 *
 * @author Matt
 */
public class GridTexture extends TextureProvider{

    private float gridSize = 100;
    private float gridRes = 1;
    
    PVector sheetColor = new PVector(.95f,.95f,.95f);
    PVector gridColor = new PVector(.1f,.1f,.3f);
    PVector minGridColor = new PVector(.5f,.3f,.3f);
    
    public void getColor(float u, float v, PVector ret) {
        if ((u*gridSize)%20 < gridRes ||
              (v*gridSize)%20 < gridRes)
                {
            ret.set(gridColor);
        }
        else if ((u*3*gridSize)%20 < gridRes ||
              (v*3*gridSize)%20 < gridRes)
                {
            ret.set(minGridColor);
        }        
        else{
            ret.set(sheetColor);
        }
    }
    
}
